<?php
	require_once('nav.php');
	$sql="select t1.*,t2.typename from videos t1 
	left join videotype t2 
	on t1.tid = t2.tid order by vid desc";
	$result = fetch_array($sql);
	/*$r1 = mysql_query($sql);
	while($row = mysql_fetch_assoc($r1)){
		$videos[] = $row;
	}*/
	//var_dump($result);

?>
<div class="col-sm-9 col-md-10">
	<table class="table table-hover">
		<tr>
			<th>序号</th><th>名称</th><th>操作</th>
		</tr>
		<?php
			foreach($result as $index=>$row){
				/*echo "<tr><td>{$index++}</td><td>$row['videoname']</td></tr>";*/
		?>

			<tr>
				<td><?php echo $index+1; ?></td>
				<td><?php echo $row['videoname'];?></td>
				<td>
					<a href="videoEdit-Form.php?id=<?php echo $row['vid'];?>" class="btn btn-primary">修改</a>&nbsp;&nbsp;
					<a href="videoDelete.php?id=<?php echo $row['vid'];?>" class="btn btn-warning" onClick="return confirm('确认删除吗？');">删除</a>
				</td>
			</tr>



		<?php
			}
		?>
	</table>
</div>
<?php
 require_once('footer.php');
 ?>